cmake_minimum_required(VERSION 3.16)
project(RPC)

# Set C++ standard to 17, as required by the project
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Common include directories
include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/../../
)

# Add standard library search path
link_directories(/usr/local/lib)

# Link libraries - pthread, jsoncpp, mylogs, etc.
# These might be adjusted based on your system
# Corrected mylog to mylogs to match the include directory name
# mylogs is a header-only library, so it doesn't need to be linked.
set(MYRPC_LIBS pthread jsoncpp muduo_net muduo_base)

# --- Executables ---

add_executable(registry_server registry_server.cc)
target_link_libraries(registry_server PRIVATE ${MYRPC_LIBS})

add_executable(rpc_server1 rpc_server1.cc)
target_link_libraries(rpc_server1 PRIVATE ${MYRPC_LIBS})

add_executable(rpc_server2 rpc_server2.cc)
target_link_libraries(rpc_server2 PRIVATE ${MYRPC_LIBS})

add_executable(rpc_server3 rpc_server3.cc)
target_link_libraries(rpc_server3 PRIVATE ${MYRPC_LIBS})

add_executable(rpc_server4 rpc_server4.cc)
target_link_libraries(rpc_server4 PRIVATE ${MYRPC_LIBS})

add_executable(rpc_server5 rpc_server5.cc)
target_link_libraries(rpc_server5 PRIVATE ${MYRPC_LIBS})

add_executable(rpc_server6 rpc_server6.cc)
target_link_libraries(rpc_server6 PRIVATE ${MYRPC_LIBS})

# add_executable(rpc_client1 rpc_client1.cc)
# target_link_libraries(rpc_client1 PRIVATE ${MYRPC_LIBS})

# add_executable(rpc_client2 rpc_client2.cc)
# target_link_libraries(rpc_client2 PRIVATE ${MYRPC_LIBS})

# add_executable(rpc_client3 rpc_client3.cc)
# target_link_libraries(rpc_client3 PRIVATE ${MYRPC_LIBS})

# add_executable(rpc_client_stress rpc_client_stress.cc)
# target_link_libraries(rpc_client_stress PRIVATE ${MYRPC_LIBS})

add_executable(rpc_client_stress1 rpc_client_stress1.cc)
target_link_libraries(rpc_client_stress1 PRIVATE ${MYRPC_LIBS})

add_executable(rpc_client_stress2 rpc_client_stress2.cc)
target_link_libraries(rpc_client_stress2 PRIVATE ${MYRPC_LIBS})

